home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00136_List of Retrievable Games.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  2.2 KB  |  92 lines

  1. property pGameList, pSpr, pLastLine, pMember
  2. global gDemoVersion
  3.  
  4. on beginSprite me
  5.   pSpr = sprite(me.spriteNum)
  6.   pGameList = getSavedGamesList()
  7.   if count(pGameList) <= 8 then
  8.     pSpr.member = nextMember(pSpr.member)
  9.     pSpr.member.boxType = #adjust
  10.   else
  11.     pSpr.member.boxType = #scroll
  12.   end if
  13.   pMember = pSpr.member
  14.   pMember.scrollTop = 0
  15.   pMember.color = white()
  16.   oldTabs = pMember.Tabs
  17.   temp = EMPTY
  18.   if gDemoVersion then
  19.     pMember.text = "The Load Game Feature is disabled in this demo version. Use the Last Call Online link on the main menu to purchase the release version from our web site."
  20.   else
  21.     if count(pGameList) = 0 then
  22.       pMember.text = "No Saved Games Found"
  23.     else
  24.       repeat with X = 1 to count(pGameList)
  25.         this = pGameList[X]
  26.         levelDisplay = this[#level]
  27.         if this[#mode] = #bonus then
  28.           levelDisplay = levelDisplay & "B"
  29.         end if
  30.         put this[#playerName] & TAB & levelDisplay & TAB & "$" && float(this[#tips]) & RETURN after oldTabs
  31.       end repeat
  32.       delete char -30000 of temp
  33.       pMember.text = temp
  34.     end if
  35.   end if
  36.   pMember.Tabs = oldTabs
  37. end
  38.  
  39. on endSprite me
  40. end
  41.  
  42. on mouseDown me
  43.   if gDemoVersion then
  44.     alertBeep()
  45.     exit
  46.   end if
  47.   if count(pGameList) then
  48.     pMember.color = white()
  49.     lineNum = PointToLine(pSpr, the mouseLoc)
  50.     if lineNum < 1 then
  51.       pLastLine = 0
  52.       exit
  53.     end if
  54.     if lineNum = pLastLine then
  55.       pLastLine = 0
  56.     else
  57.       pMember.line[lineNum].color = red()
  58.       pLastLine = lineNum
  59.     end if
  60.   end if
  61. end
  62.  
  63. on retrieveGame me
  64.   global gRetrievedGame, gNameChosen, gInText, gLastSavedGameName
  65.   gRetrievedGame = 0
  66.   newGame = 1
  67.   if count(pGameList) then
  68.     if pLastLine < 1 then
  69.     else
  70.       gLastSavedGameName = pGameList[pLastLine][#File]
  71.       data = retrieveFile(gLastSavedGameName)
  72.       if not voidp(data) then
  73.         valid = readHeaderData(data)
  74.         if valid then
  75.           gRetrievedGame = 1
  76.           newGame = 0
  77.           gNameChosen = 1
  78.           if inBonusMode() then
  79.             startBonusMode()
  80.           end if
  81.           returnToBar()
  82.         else
  83.           MUIalert("Not a valid saved game file")
  84.         end if
  85.       end if
  86.     end if
  87.   end if
  88.   if newGame then
  89.     go("New Game")
  90.   end if
  91. end
  92.